package com.huayun.code.gen.filter;

import com.huayun.code.core.extractor.ColumnFilter;
import com.huayun.code.core.model.Column;
import org.apache.commons.lang3.ArrayUtils;
import org.springframework.stereotype.Component;

@Component
public class CommonFieldFilter implements ColumnFilter {

    private String[] IGNORE_COLUME_NAMES = new String[]{"id", "if_disabled", "if_deleted", "create_by", "update_by", "create_time", "update_time"};

    public CommonFieldFilter() {
    }

    @Override
    public boolean filter(Column col) {
        return ArrayUtils.contains(IGNORE_COLUME_NAMES, col.getName().toLowerCase());
    }

}